#ifndef __ZM32_AP_H__
#define __ZM32_AP_H__


#include "zm32_message.h"

typedef enum dev_role
{
    EN_DEV_ROLE_ENDDEVICE = 0x00,             // 终端设备
    EN_DEV_ROLE_ROUTER = 0x01,                // 路由设备
    EN_DEV_ROLE_COORDINATOR = 0x02            // 协调器
} dev_role_te;

typedef enum operation_type
{
    EN_OPT_READ = 0x00,
    EN_OPT_WRITE
} operation_type_te;

typedef enum networking_mode
{
    EN_NWKING_MODE_DISABLE,     //关闭自组网
    EN_NWKING_MODE_MANUAL,      //手动组网
    EN_NWKING_MODE_AUTO         //自动组网
} networking_mode_te;

int zm32_getMessageLength( unsigned int u32Type, unsigned int *length );

int zm32_set_nwkaddr_req( unsigned short nwkaddr );

void zm32_set_nwkaddr_resp( void *respmsg );

int zm32_get_local_config_req( void );

void zm32_get_local_config_resp( void *respmsg );

int zm32_set_remote_config_req( struct pstnwk_set_remote_conf_req *req );

void zm32_set_remote_config_resp( void *respmsg );

int zm32_networking_node_req( dev_role_te role, operation_type_te opt, networking_mode_te mode );

void zm32_networking_node_resp( void *respmsg );

int zm32_reset_remote_req( unsigned short nwkaddr, unsigned short protocol );

int zm32_get_networking_state_req( void );

void zm32_get_networking_state_resp( void *respmsg );

int zm32_spec_tx_frame(const void *dst, unsigned int dst_sz, const void *data, unsigned int len);

int zm32_spec_grptx_frame(unsigned short grp, const void *data, unsigned int len);

void zm32_spec_rx_frame(void *msg);

void zm32_spec_grprx_frame(void *msg);

int zm32_tmploc_tx_mode_req(unsigned  char mode, unsigned char needmac,
                            unsigned char addrmode, unsigned char format);
void zm32_tmploc_tx_mode_resp(void *msg);

int zm32_tmpmac_rx_mode_req(unsigned long long macaddr, unsigned char mode);
void zm32_tmpmac_rx_mode_resp(void *msg);

int zm32_permit_join_req(unsigned short dur);
void zm32_permit_join_resp(void *msg);

#endif